package com.woniuxy.commons.service;

import com.woniuxy.commons.entity.Goods;
import com.woniuxy.commons.service.factory.ProviderServiceFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "PROVIDER",fallbackFactory = ProviderServiceFactory.class)  //name指定调用生产者微服务的名字,fallbackFactory指定工厂类
public interface ProviderService {
    @GetMapping("/goods/all")
    public List<Goods> all();

    @GetMapping("/goods/find/{id}")
    public Goods find(@PathVariable(value = "id") int id);

    @PostMapping("/goods/add")
    public boolean  add(@RequestBody Goods goods);
    @PutMapping("/goods/update")
    public void  update(@RequestBody Goods goods);
}
